//package com.yunxin.admin.system.api.core.channel;
//
//import com.yunxin.admin.system.infra.common.constant.SecurityConstants;
//import com.yunxin.admin.system.infra.framework.resubmit.Resubmit;
//import com.yunxin.admin.system.infra.framework.security.util.SecurityUtils;
//import com.yunxin.admin.system.infra.framework.syslog.AutoLog;
//import com.yunxin.common.result.PageResult;
//import com.yunxin.common.result.Result;
//import com.yunxin.core.application.command.channel.AddChannelTypeCommand;
//import com.yunxin.core.application.command.channel.ChannelTypePageCommand;
//import com.yunxin.core.application.command.channel.UpdateChannelTypeCommand;
//import com.yunxin.core.application.dto.channel.ChannelTypeListDTO;
//import com.yunxin.core.application.dto.channel.ChannelTypePageDTO;
//import com.yunxin.core.application.service.ChannelApplicationAdminService;
//import com.yunxin.core.application.service.ChannelQueryAdminService;
//import io.swagger.v3.oas.annotations.Operation;
//import io.swagger.v3.oas.annotations.security.SecurityRequirement;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * @author zero°
// * @since 2023-05-29
// */
//@Tag(name = "12.渠道类型管理")
//@Slf4j
//@RestController
//@RequestMapping("/core/v1/channel/type")
//@RequiredArgsConstructor
//public class ChannelTypeController {
//
//
//    private final ChannelQueryAdminService channelQueryAdminService;
//
//    private final ChannelApplicationAdminService channelApplicationAdminService;
//
//    @Operation(summary = "新增渠道类型", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @PostMapping("/addChannelType")
//    @PreAuthorize("@ss.hasPerm('core:channel_type:add')")
//    @Resubmit
//    @AutoLog(value = "新增渠道类型")
//    public Result<Boolean> addChannelType(@Validated @RequestBody AddChannelTypeCommand command) {
//        command.setCreator(SecurityUtils.X.getUser().getUsername());
//        return Result.success(channelApplicationAdminService.addChannelType(command));
//    }
//
//    @Operation(summary = "更新渠道类型", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @PostMapping("/updateChannelType")
//    @PreAuthorize("@ss.hasPerm('core:channel_type:edit')")
//    @Resubmit
//    @AutoLog(value = "更新渠道类型")
//    public Result<Boolean> updateChannelType(@Validated @RequestBody UpdateChannelTypeCommand command) {
//        command.setEditor(SecurityUtils.X.getUser().getUsername());
//        return Result.success(channelApplicationAdminService.updateChannelType(command));
//    }
//
//    @Operation(summary = "获取渠道类型下拉列表", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @GetMapping("/listChannelType")
//    public Result<List<ChannelTypeListDTO>> listChannelType() {
//        List<ChannelTypeListDTO> result = channelQueryAdminService.listChannelType();
//        return Result.success(result);
//    }
//
//    @Operation(summary = "分页查询渠道类型列表", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @PostMapping("/channelTypePageQuery")
//    public PageResult<ChannelTypePageDTO> channelTypePageQuery(@Validated @RequestBody ChannelTypePageCommand command) {
//        return channelQueryAdminService.channelTypePageQuery(command);
//    }
//}
